<?php
header('cont-type:text/html;charset=utf-8');
$user = $_POST['username'];
$pass = $_POST['password'];
$con = mysqli_connect('localhost','root','root','class');
if($con) {
    $sql = "insert into user(name,password) values('$user','$pass')";
    $result = mysqli_query($con,$sql);
    if($result) {
        echo '1';
    } else {
        echo '0';
    }
} else {
    echo '连接失败！';
}
?>